/*!
 * @file  readTemperature.ino
 * @brief Get the temperature
 * @n Experimental phenomenon: serial print the temperature
 * @copyright   Copyright (c) 2010 DFRobot Co.Ltd (http://www.dfrobot.com)
 * @license     The MIT License (MIT)
 * @author      [lym](yiming.luo@dfrobot.com)
 * @version     V1.0.2
 * @date        2025-02-20
 * @url         https://github.com/DFRobot/DFRobot_PT100
 */
#include "DFRobot_PT100.h"

/**
 * Set sensor reference voltage,you need test your MCU IOREF voltage.
 */
const float voltageRef = 5.000;

/**
 * Set pin with adc function to read sensor analog value  (such as: A0~A5 on arduino uno)
 */
int PT100_Pin = A0; 

DFRobot_PT100 PT100 = DFRobot_PT100(voltageRef); 

void setup(void)
{
    Serial.begin(115200);
}

void loop(void)
{
    int temperature = PT100.readTemperature(PT100_Pin); // Get temperature
    Serial.print("temperature:");
    Serial.print(temperature);
    Serial.println("  ^C");
    delay(1000);
}